﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace DiscoveryLogic.UI.Charts
{
    /// <summary>
    /// Charts.ElementPositionData class
    /// (Used for positioning elements)
    /// </summary>
    internal class ElementPositionData
    {
        #region Public Methods

        /// <summary>
        /// Initializes a new instance of the Charts.ElementPositionData class
        /// </summary>
        public ElementPositionData()
        {
        }

        /// <summary>
        /// Contains data for Positioning elements 
        /// </summary>
        /// <param name="element">Element</param>
        /// <param name="angle1">Angle1</param>
        /// <param name="angle2">Angle2</param>
        public ElementPositionData(FrameworkElement element, Double angle1, Double angle2)
        {
            Element = element;
            StartAngle = angle1;
            StopAngle = angle2;
        }

        /// <summary>
        /// Contains data for Positioning elements 
        /// </summary>
        /// <param name="m">ElementPosition</param>
        public ElementPositionData(ElementPositionData elementPosition)
        {
            Element = elementPosition.Element;
            StartAngle = elementPosition.StartAngle;
            StopAngle = elementPosition.StopAngle;
        }

        /// <summary>
        /// Compare angles for two position elements
        /// </summary>
        /// <param name="a">ElementPosition1</param>
        /// <param name="b">ElementPosition1</param>
        /// <returns></returns>
        public static Int32 CompareAngle(ElementPositionData elementPosition1, ElementPositionData elementPosition2)
        {
            Double angle1 = (elementPosition1.StartAngle + elementPosition1.StopAngle) / 2;
            Double angle2 = (elementPosition2.StartAngle + elementPosition2.StopAngle) / 2;
            return angle1.CompareTo(angle2);
        }

        #endregion Public Methods

        #region Public Properties

        /// <summary>
        /// FrameworkElement
        /// </summary>
        public FrameworkElement Element
        {
            get;
            set;
        }

        /// <summary>
        /// Start angle  
        /// </summary>
        public Double StartAngle
        {
            get;
            set;
        }

        /// <summary>
        /// Stop angle
        /// </summary>
        public Double StopAngle
        {
            get;
            set;
        }

        #endregion
    }
}
